///
/// This is the main() for the Server
///

#include <iostream>
#include <netdb.h>
#include <arpa/inet.h>
#include <cstring>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <cstdio>
#include "common.h"
#include <map>
#include <cassert>
#include "Server.h"

int main(int argc, char** argv)
{
	//make sure you're called correctly
	if(argc != 3)
	{
		std::cout << "Usage: ./server IPaddr PortNo" << std::endl;
		return 1;
	}

	Server* server = Server::GetInstance();
	server->Initialize(argv[1], argv[2]);

	server->Execute();

	Server::Destroy();

	return 0;
}
